package com.lw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lw.mapper.RoleMapper;
import com.lw.service.RoleService;
import com.lw.system.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
    @Autowired
    RoleMapper roleMapper;
    @Override
    public Page<Role> findAll(int current, int size,String companyId) {
        Page<Role> page = new Page<>( current, size);
        Page<Role> roles = roleMapper.findAll( page, new QueryWrapper<Role>().eq( "company_id", companyId ) );
        return roles;
    }
}
